//
//  HYHomeViewModel.h
//  XPlayer
//
//  Created by liguoqing on 2023/8/12.
//

#import <BaseWithRAC/BaseViewModel.h>
#import "HYHomeFileItemViewModel.h"
#import "HYVideoViewModel.h"

@class HYHomeVideoModel;
@class HYVideoPlayerConfig;

NS_ASSUME_NONNULL_BEGIN

@interface HYHomeViewModel : BaseViewModel
/// 是否是首页
@property (nonatomic, assign) BOOL isHome;
// 首页
@property (nonatomic, strong) NSString *folderLocation;
// 首页文件夹标识
@property (nonatomic, strong) NSString *folderIdentification;
// 是否是私密文件夹
@property (nonatomic, assign) BOOL isPrivate;

@property (nonatomic, strong) RACSubject *setSubject;

@property (nonatomic, strong) RACSubject *reloadSubject;

@property (nonatomic, strong) RACSubject *showFileSubject;

@property (nonatomic, strong) RACSubject *popSubject;

@property (nonatomic, strong) RACSubject *refreshSubject;
// 父类文件夹路径
@property (nonatomic, strong) NSString *parentPath;
// 当前文件夹路径
@property (nonatomic, strong) NSString *folderPath;
// 被选中的文件夹
@property (nonatomic, strong) HYHomeFileItemViewModel *selectFolderModel;
// 当前是文件导入
@property (nonatomic, assign) BOOL isFileMove;

- (instancetype)initWithFolderLocation:(NSString *)folderLocation
                  folderIdentification:(NSString *)folderIdentification;

- (instancetype)initWithParentPath:(NSString *)parentPath
                 currentFolderPath:(NSString *)currentFolderPath;

- (void)initSignal;

- (void)fetchData:(HYHomeFileType)type;

- (NSInteger)numberOfRowsIsHeader:(BOOL)isHeader fileType:(HYHomeFileType)fileType;

- (id)cellForRowAtIndexPath:(NSIndexPath *)indexPath isHeader:(BOOL)isHeader fileType:(HYHomeFileType)fileType;

- (HYHomeFileType)fetchFileType:(NSIndexPath *)indexPath fileType:(HYHomeFileType)fileType;

- (void)deleteRowsAtIndexPaths:(NSIndexPath *)indexPath fileType:(HYHomeFileType)fileType;

- (void)didSelectRowAtIndexPath:(NSIndexPath *)indexPath isHeader:(BOOL)isHeader fileType:(HYHomeFileType)fileType;

- (HYHomeFileItemViewModel *)fetchMyDocumentViewModel;

/// 添加创建的文件夹
- (void)addNewFolderWithFolderName:(NSString *)folderName completeBlock:(HYBIdBlock)completeBlock;
/// 创建文件夹
- (void)createFolderWithFolderName:(NSString *)folderName completeBlock:(HYBIdBlock)completeBlock;
/// 获取当前列表下的文件夹
- (NSArray *)fetchCurrentListFolder:(HYHomeFileItemViewModel *)fileVM;
/// 修改文件名称
- (void)modifyFileNameWithFileViewModel:(HYHomeFileItemViewModel *)fileVM;
/// 添加新建视频
- (void)addNewVideoWithVideoModel:(HYHomeVideoModel *)videoModel;
/// 刷新相册视频个数数量
- (void)reloadMyPhotoVideoCount:(NSInteger)videoCount;
/// 选择要移动文件夹
- (void)selectMoveToFolderItemViewModel:(HYHomeFileItemViewModel *)itemViewModel;
/// 取消之前的选中状态
- (void)cancelSelectStatus;
/// 移动文件或文件夹到指定的文件夹
- (void)moveToFolderWithCurrentFile:(HYHomeFileItemViewModel *)currentFileModel
                      completeBlock:(dispatch_block_t)completeBlock;
/// 移除文件夹或文件夹
- (void)deleteFilWithFileViewModel:(HYHomeFileItemViewModel *)fileVM;
/// 加锁或解锁文件夹
- (void)lockOrUnLockFoldeWithFileViewModel:(HYHomeFileItemViewModel *)fileVM;
/// 获取视频config
- (id)fetchPlayVideoConfigWithItemViewModel:(HYHomeFileItemViewModel *)itemViewModel;
/// 获取当前视频
- (id)fetchCurrentVideoWithFileModel:(HYHomeFileItemViewModel *)fileModel;
/// 检测播放地址是否有效
- (BOOL)checkVideoPlayUrl:(NSString *)videoUrl;

@end

NS_ASSUME_NONNULL_END
